package com.example.yuejian.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.yuejian.Adapter.OrderAdapter;
import com.example.yuejian.Bean.OrderBean;
import com.example.yuejian.R;
import com.example.yuejian.listener.ClubListener;
import com.example.yuejian.model.OrderModel;

import java.util.List;

public class UnsendFragment extends Fragment implements ClubListener<OrderBean> {
    View view;
    RecyclerView recyclerView_clublist;
    @Override
    public View onCreateView(LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState)
    {
        view = inflater.inflate(R.layout.fragment_order_send, null) ;
        recyclerView_clublist = (RecyclerView)view.findViewById(R.id.recyclerView_clublist);
        recyclerView_clublist.setLayoutManager(new LinearLayoutManager(getActivity()));
        OrderModel orderModel = new OrderModel();
        orderModel.orederData(this);
        return view ;
    }

    @Override
    public void onResponse(OrderBean order) {
        List<OrderBean.OrderlistBean> orderlistBeen = order.getOrderlist();
        OrderAdapter adapter = new OrderAdapter(getActivity(),orderlistBeen);
        recyclerView_clublist.setAdapter(adapter);
    }

    @Override
    public void onFail(String msg) {

    }
}